<template>
  <a-config-provider :locale="locale">
    <router-view v-if="isRouterAlive" />
  </a-config-provider>
</template>

<script>
  import zhCN from 'ant-design-vue/es/locale/zh_CN'

  export default {
    name: 'App',
    provide() {
      return {
        pageReload: this.pageReload,
      }
    },
    data() {
      return {
        locale: zhCN,
        isRouterAlive: true,
      }
    },
    methods: {
      pageReload() {
        this.isRouterAlive = false
        this.$nextTick(function () {
          this.isRouterAlive = true
        })
      },
    },
  }
</script>

<style lang="less">
  @import '~@/assets/styles/app.less';
</style>
